Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Event dispatching thread</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Event_dispatching_thread"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Event_dispatching_thread rootpage-Event_dispatching_thread skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Event dispatching thread</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p>The <b>event dispatching thread</b> (EDT) is a background <a href="Thread_(computing)" title="Thread (computing)">thread</a> used in <a href="Java_(programming_language)" title="Java (programming language)">Java</a> to process events from the <a href="Abstract_Window_Toolkit" title="Abstract Window Toolkit">Abstract Window Toolkit</a> (AWT) <a href="Graphical_user_interface" title="Graphical user interface">graphical user interface</a> <a href="Event_queue" class="mw-redirect" title="Event queue">event queue</a>. It is an example of the generic concept of <a href="Event-driven_programming" title="Event-driven programming">event-driven programming</a>, that is popular in many other contexts than Java, for example, <a href="Web_browser" title="Web browser">web browsers</a>, or <a href="Web_server" title="Web server">web servers</a>.
</p><p>The events are primarily update events that cause user interface <a href="Software_componentry" class="mw-redirect" title="Software componentry">components</a> to redraw themselves, or input events from <a href="Input_device" title="Input device">input devices</a> such as the mouse or keyboard. The AWT uses a single-threaded painting <a href="Model_(abstract)" class="mw-redirect" title="Model (abstract)">model</a> in which all screen updates must be performed from a single thread. The event dispatching thread is the only valid thread to update the visual state of visible user interface components. Updating visible components from other threads is the source of many common <a href="Software_bug" title="Software bug">bugs</a> in Java <a href="Computer_program" title="Computer program">programs</a> that use <a href="Swing_(Java)" title="Swing (Java)">Swing</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> The event dispatching thread is called the <b>primordial worker</b> in <a href="Adobe_Flash" title="Adobe Flash">Adobe Flash</a> and the <b>UI thread</b> in <a href="Standard_Widget_Toolkit" title="Standard Widget Toolkit">SWT</a>, <a href=".NET_Framework" title=".NET Framework">.NET Framework</a> and <a href="Android_(operating_system)" title="Android (operating system)">Android</a>.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Message_loop_for_serializing_GUI_accesses">Message loop for serializing GUI accesses</h2></div>
<p>A software application normally consists of multiple threads and a single GIT data structure. This means GIT is a shared data structure and some synchronization is needed to ensure that only one thread accesses it at a time. Though <a href="Abstract_Window_Toolkit" title="Abstract Window Toolkit">AWT</a> and <a href="Swing_(Java)" title="Swing (Java)">Swing</a> expose the (<a href="Thread_safety" title="Thread safety">thread unsafe</a>) methods to create and access the GUI components and these methods are visible to all application threads, likewise in other GUI frameworks, only a single, Event Dispatching thread has the right to execute these methods.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
Since programmers often miss this requirement, third-party <a href="Pluggable_look_and_feel" title="Pluggable look and feel">Look and Feels</a>, like <a rel="nofollow" class="external text" href="http://java.net/projects/substance/">Substance</a> go as far as to refuse to instantiate any Swing component when not running within the Event Dispatch Thread,<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> to prevent such a coding mistake. Access to the GUI is serialized and other threads may submit some code to be executed in the EDT through a <b>EDT message queue</b>.
</p><p>That is, likewise in other GUI frameworks, the Event Dispatching Thread spends its life pumping messages: it maintains a message queue of actions to be performed over GUI. These requests are submitted to the queue by system and any application thread. EDT consumes them one after another and responds by updating the GUI components. The messages may be well-known actions or involve callbacks, the references to user-methods that must be executed by means of EDT.
</p><p>The important requirement imposed on all messages is that they must be executed quickly for the GUI to stay responsive. Otherwise, the message loop is blocked and GUI freezing is experienced.
</p>
<div class="mw-heading mw-heading2"><h2 id="Submitting_user_code_to_the_EDT">Submitting user code to the EDT</h2></div>
<p>There are various solutions for submitting code to the EDT and performing lengthy tasks without blocking the loop.
</p>
<div class="mw-heading mw-heading3"><h3 id="Component_event_handlers_(listeners)">Component event handlers (listeners)</h3></div>
<p>GUI components support the lists of callbacks, called Listeners, which are typically populated when the components are created. EDT executes the listeners when user excitates the components somehow (button is clicked, mouse is moved, item is selected, focus is lost, component resized and so on.)
</p>
<div class="mw-heading mw-heading3"><h3 id="Timer">Timer</h3></div>
<p>For short tasks that must access/modify GUI periodically or at specific time, <code>javax.swing.Timer</code> is used. It can be considered as an invisible GUI component, whose listeners are registered to fire at specific time(s).
</p><p>Equivalents
</p>
<ul><li><code>System.Windows.Forms.Timer</code> - <a href=".NET_Framework" title=".NET Framework">.NET Framework</a></li>
<li><code>flash.utils.Timer</code> - <a href="Adobe_Flash" title="Adobe Flash">Adobe Flash</a></li></ul>
<div class="mw-heading mw-heading3"><h3 id="Requests_from_other_threads">Requests from other threads</h3></div>
<p>Other application threads can pass some code to be executed in the event dispatching thread by means of <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/SwingUtilities.html">SwingUtilities</a></code> helper classes (or <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/java/awt/EventQueue.html">EventQueue</a></code> if you are doing <a href="Abstract_Window_Toolkit" title="Abstract Window Toolkit">AWT</a>). The submitted code must be wrapped with a <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/Runnable.html">Runnable</a></code> object. Two methods of these classes allow:
</p>
<ul><li>synchronous code execution (<code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/SwingUtilities.html#invokeAndWait(java.lang.Runnable)">SwingUtilities.invokeAndWait(Runnable)</a></code> or <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/java/awt/EventQueue.html#invokeAndWait(java.lang.Runnable)">EventQueue.invokeAndWait(Runnable)</a></code>)</li>
<li>and asynchronous code execution (<code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable)">SwingUtilities.invokeLater(Runnable)</a></code> or <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/java/awt/EventQueue.html#invokeLater(java.lang.Runnable)">EventQueue.invokeLater(Runnable)</a></code>)</li></ul>
<p>from the event dispatching thread.
</p><p>The method <code>invokeAndWait()</code> should never be called from the event dispatching thread—it will throw an <a href="Exception_handling" title="Exception handling">exception</a>. The method <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/SwingUtilities.html#isEventDispatchThread()">SwingUtilities.isEventDispatchThread()</a></code> or <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/java/awt/EventQueue.html#isDispatchThread()">EventQueue.isDispatchThread()</a></code> can be called to determine if the current thread is the event dispatching thread.
</p><p>The code supplied by means of the <code>invokeLater</code> and <code>invokeAndWait</code> to the EDT must be as quick as possible to prevent freezing. They are normally intended to deliver the result of a lengthy computation to the GUI (user).
</p>
<div class="mw-heading mw-heading3"><h3 id="Worker_design_pattern">Worker design pattern</h3></div>
<p>Both execution of a task in another thread and presenting the results in the EDT can be combined by means of <i><a href="SwingWorker" title="SwingWorker">worker design pattern</a></i>. The <code><a href="SwingWorker" title="SwingWorker">javax.swing.SwingWorker</a></code> class, developed by <a href="Sun_Microsystems" title="Sun Microsystems">Sun Microsystems</a>, is an implementation of the worker design pattern, and as of Java 6 is part of standard Swing distribution. SwingWorker is normally invoked from EDT-executed event Listener to perform a lengthy task in order not to block the EDT.
</p>
<div class="mw-heading mw-heading4"><h4 id="Samples">Samples</h4></div>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="n">SwingWorker</span><span class="o">&lt;</span><span class="n">Document</span><span class="p">,</span><span class="w"> </span><span class="n">Void</span><span class="o">&gt;</span><span class="w"> </span><span class="n">worker</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">SwingWorker</span><span class="o">&lt;</span><span class="n">Document</span><span class="p">,</span><span class="w"> </span><span class="n">Void</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kd">public</span><span class="w"> </span><span class="n">Document</span><span class="w"> </span><span class="nf">doInBackground</span><span class="p">()</span><span class="w"> </span><span class="kd">throws</span><span class="w"> </span><span class="n">IOException</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">loadXML</span><span class="p">();</span><span class="w"> </span><span class="c1">// heavy task</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span>
<span class="w"> </span><span class="kd">public</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">done</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">Document</span><span class="w"> </span><span class="n">doc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">get</span><span class="p">();</span>
<span class="w"> </span><span class="n">display</span><span class="p">(</span><span class="n">doc</span><span class="p">);</span>
<span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">ex</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">ex</span><span class="p">.</span><span class="na">printStackTrace</span><span class="p">();</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">};</span>
<span class="n">worker</span><span class="p">.</span><span class="na">execute</span><span class="p">();</span>
</pre></div>
<p>If you use <a href="Groovy_(programming_language)" class="mw-redirect" title="Groovy (programming language)">Groovy</a> and <code>groovy.swing.SwingBuilder</code>, you can use <code>doLater()</code>, <code>doOutside()</code>, and <code>edt()</code>. Then you can write it more simply like this:
</p>
<div class="mw-highlight mw-highlight-lang-groovy mw-content-ltr" dir="ltr"><pre><span class="n">doOutside</span><span class="w"> </span><span class="o">{</span>
<span class="w"> </span><span class="kt">def</span><span class="w"> </span><span class="n">doc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">loadXML</span><span class="o">()</span><span class="w"> </span><span class="c1">// heavy task</span>
<span class="w"> </span><span class="n">edt</span><span class="w"> </span><span class="o">{</span><span class="w"> </span><span class="n">display</span><span class="o">(</span><span class="n">doc</span><span class="o">)</span><span class="w"> </span><span class="o">}</span>
<span class="o">}</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Equivalents">Equivalents</h4></div>
<ul><li><code>System.ComponentModel.BackgroundWorker</code> - <a href=".NET_Framework" title=".NET Framework">.NET Framework</a></li>
<li><code>flash.system.Worker</code> - <a href="Adobe_Flash" title="Adobe Flash">Adobe Flash</a></li>
<li><code>android.os.AsyncTask</code> - <a href="Android_(operating_system)" title="Android (operating system)">Android</a></li></ul>
<div class="mw-heading mw-heading3"><h3 id="Modal_execution">Modal execution</h3></div>
<p>SwingWorker is normally created for a lengthy tasks by EDT while handling callback (Listener) events. Spawning a worker thread, EDT proceeds handling current message without waiting the worker to complete. <a rel="nofollow" class="external text" href="https://stackoverflow.com/questions/3028842/how-can-swing-dialogs-even-work">Often, this is not desirable.</a>
</p><p>Often, your EDT handles a GUI component action, which demands the user to make a choice by means of another dialog, like JFileChooser, which pops up, stays responsive while user picks its option and action proceeds with selected file only after "OK" button is pressed. You see, this takes time (user responds in matter of seconds) and you need a responsive GUI (the messages are still pumped in EDT) during all this time while EDT is blocking (it does not handle newer, e.g. JFileChooser, messages in the queue before the dialog is closed and current component action is finished). The vicious cycle is broken through EDT entering a new message loop, which dispatches the messages as per normal until "modal dialog is over" arrives and normal message processing resumes from the blocked position in the component action.
</p><p>The open source <b><a rel="nofollow" class="external text" href="https://foxtrot.sourceforge.net/docs/worker.php">Foxtrot</a></b> project emulates the Swing message loop pumping to provide the "synchronous" execution mechanism for arbitrary user tasks, which proceeds only after the worker completes the task.
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="n">button</span><span class="p">.</span><span class="na">addActionListener</span><span class="p">(</span><span class="k">new</span><span class="w"> </span><span class="n">ActionListener</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kd">public</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">actionPerformed</span><span class="p">(</span><span class="n">ActionEvent</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">button</span><span class="p">.</span><span class="na">setText</span><span class="p">(</span><span class="s">"Sleeping..."</span><span class="p">);</span>

<span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">text</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">null</span><span class="p">;</span>
<span class="w"> </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">text</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">String</span><span class="p">)</span><span class="w"> </span><span class="n">Worker</span><span class="p">.</span><span class="na">post</span><span class="p">(</span><span class="k">new</span><span class="w"> </span><span class="n">Task</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kd">public</span><span class="w"> </span><span class="n">Object</span><span class="w"> </span><span class="nf">run</span><span class="p">()</span><span class="w"> </span><span class="kd">throws</span><span class="w"> </span><span class="n">Exception</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">Thread</span><span class="p">.</span><span class="na">sleep</span><span class="p">(</span><span class="mi">10000</span><span class="p">);</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="s">"Slept&nbsp;!"</span><span class="p">;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">});</span>
<span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">x</span><span class="p">)...</span>

<span class="w"> </span><span class="n">button</span><span class="p">.</span><span class="na">setText</span><span class="p">(</span><span class="n">text</span><span class="p">);</span>

<span class="w"> </span><span class="n">somethingElse</span><span class="p">();</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">});</span>
</pre></div>
<p>Since Java 1.7, Java provides <b>standard</b> solution for custom <b>secondary message loops</b> by exposing <i>createSecondaryLoop</i>() in system <i>EventQueue</i>().
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Abstract_Window_Toolkit" title="Abstract Window Toolkit">Abstract Window Toolkit</a> (AWT)</li>
<li><a href="Swing_(Java)" title="Swing (Java)">Swing (Java)</a></li>
<li><a href="SwingWorker" title="SwingWorker">SwingWorker</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist reflist-columns references-column-width" style="column-width: 30em;">
<ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text">This problem is not specific to Java <a href="Swing_(Java)" title="Swing (Java)">Swing</a>. There is the same issue in most <a href="Widget_toolkit" title="Widget toolkit">Widget toolkits</a>, as for example <a href="Windows_Forms" title="Windows Forms">Windows Forms</a>, where the <a href="BackgroundWorker" class="mw-redirect" title="BackgroundWorker">BackgroundWorker</a> class performs the same purpose as <a href="SwingWorker" title="SwingWorker">SwingWorker</a> in Java.</span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://download.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html">"The Event Dispatch Thread"</a>. <a href="Sun_Microsystems" title="Sun Microsystems">Sun Microsystems</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2011-10-02</span></span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20110805132240/http://weblogs.java.net/blog/alexfromsun/archive/2005/11/debugging_swing_1.html">"Debugging Swing - is it really difficult?"</a>. Alexander Potochkin. Archived from <a rel="nofollow" class="external text" href="http://weblogs.java.net/blog/alexfromsun/archive/2005/11/debugging_swing_1.html">the original</a> on 2011-08-05<span class="reference-accessdate">. Retrieved <span class="nowrap">2011-10-02</span></span>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://download.oracle.com/javase/tutorial/uiswing/concurrency/initial.html">"Initial Threads"</a>. <a href="Sun_Microsystems" title="Sun Microsystems">Sun Microsystems</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2011-10-02</span></span>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.pushing-pixels.org/?p=368">"Stricter checks on EDT violations in Substance · Pushing Pixels"</a>.</cite></span>
</li>
</ol></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/package-summary.html">javax.swing</a></code> (Swing API <a href="Javadoc" title="Javadoc">Javadoc</a> documentation)</li>
<li><code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/java/awt/package-summary.html">java.awt</a></code> (AWT API <a href="Javadoc" title="Javadoc">Javadoc</a> documentation)</li>
<li><a rel="nofollow" class="external text" href="https://docs.oracle.com/javase/8/docs/technotes/guides/swing">Swing API documentation</a></li>
<li><a rel="nofollow" class="external text" href="http://download.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html">The Event-Dispatching Thread</a></li>
<li><a rel="nofollow" class="external text" href="http://download.oracle.com/javase/tutorial/uiswing/concurrency/worker.html">SwingWorker</a> description from the Swing tutorial</li>
<li><a rel="nofollow" class="external text" href="http://tech.stolsvik.com/2009/03/awt-swing-event-pumping-and-targeting.html">AWT/Swing event handling</a> article about event pumping, dispatch and processing, and the EDT</li>
<li><a rel="nofollow" class="external text" href="https://foxtrot.sourceforge.net/">Foxtrot project home page</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-02-16" href="https://en.wikipedia.org/wiki/?title=Event_dispatching_thread&amp;oldid=1276036454">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>